const setStorageSync = (key, Obj) => {
	return new Promise(resolve => {
		try {
			uni.setStorageSync(key, Obj);
			resolve()
		} catch (e) {
			// error
			resolve({
				err: e
			})
		}
	})
}

const getStorageSync = (key) => {
	return new Promise(resolve => {
		try {
			let value = uni.getStorageSync(key);
			resolve(value)
		} catch (e) {
			resolve({
				err: e
			})
		}
	})
}
const removeStorageSync = (key) => {
	return new Promise(resolve => {
		try {
			uni.removeStorageSync(key);
		} catch (e) {
			resolve({
				err: e
			})
		}
	})
}
const clearStorageSync = (key) => {
	return new Promise(resolve => {
		try {
			uni.clearStorageSync();
		} catch (e) {
			
		}
	})
}

export default{
	setStorageSync,
	getStorageSync,
	removeStorageSync,
	clearStorageSync
}